from django.contrib import admin

from .models import Network, Station


@admin.register(Network)
class NetworkAdmin(admin.ModelAdmin):
    list_display = ('code', 'name_zh', 'name_en', 'status')


@admin.register(Station)
class StationAdmin(admin.ModelAdmin):
    list_display = ('code', 'network', 'name_zh', 'name_en', 'longitude', 'latitude', 'altitude', 'status')
    list_display_links = ('code',)
    search_fields = ('code', 'name_zh', 'name_en')
    list_filter = ('network', 'status')
    list_editable = ('name_zh', 'name_en', 'longitude', 'latitude', 'altitude', 'status')
